package org.penguin.boot.security.util;

import java.security.SecureRandom;
import java.util.Base64;

/**
 * @author : cyhch
 * @version : 1.0
 * @createdTime : 2023/12/21 21:39
 * @since : 1.0
 */
public class SaltUtil {

    public static final String generateSalt() {
        SecureRandom random = new SecureRandom();
        byte[] salt = new byte[16];
        random.nextBytes(salt);
        return Base64.getEncoder().encodeToString(salt);
    }
}
